/**
 * @file ch9120.h
 * @author  xiaowine (xiaowine@sina.cn)
 * @brief
 * @version 01.00
 * @date    2022-04-01
 *
 * @copyright Copyright (c) {2020}  xiaowine
 *
 * @par 修改日志:
 * <table>
 * <tr><th>Date       <th>Version <th>Author  <th>Description
 * <tr><td>2022-04-01 <td>1.0     <td>wangh     <td>内容
 * </table>
 * ******************************************************************
 * *                   .::::
 * *                 .::::::::
 * *                ::::::::::
 * *             ..:::::::::::
 * *          '::::::::::::
 * *            .:::::::::
 * *       '::::::::::::::..        女神助攻,流量冲天
 * *            ..::::::::::::.     永不宕机,代码无bug
 * *          ``:::::::::::::::
 * *           ::::``:::::::::'        .:::
 * *          ::::'   ':::::'       .::::::::
 * *        .::::'      ::::     .:::::::'::::
 * *       .:::'       :::::  .:::::::::' ':::::
 * *      .::'        :::::.:::::::::'      ':::::
 * *     .::'         ::::::::::::::'         ``::::
 * * ...:::           ::::::::::::'              ``::
 * *```` ':.          ':::::::::'                  ::::.
 * *                   '.:::::'                    ':'````.
 * ******************************************************************
 */

#ifndef __CH9120_H_
#define __CH9120_H_

/* Private includes ----------------------------------------------------------*/
#include <rtthread.h>
#include "stm32f10x.h"
/* Private typedef -----------------------------------------------------------*/

/* Private define ------------------------------------------------------------*/
#define CH9120_TCPCS_PORT GPIOC
#define CH9120_TCPCS_Pin  GPIO_Pin_6
#define CH9120_TCPCS      GPIO_ReadInputDataBit(CH9120_TCPCS_PORT, CH9120_TCPCS_Pin)

#define CH9120_CFGEN_PORT GPIOC
#define CH9120_CFGEN_Pin  GPIO_Pin_7
#define CH9120_CFGEN(x)   GPIO_WriteBit(CH9120_CFGEN_PORT, CH9120_CFGEN_Pin, (x))

#define CH9120_REST_PORT GPIOC
#define CH9120_REST_Pin  GPIO_Pin_8
#define CH9120_REST(x)   GPIO_WriteBit(CH9120_REST_PORT, CH9120_REST_Pin, (x))

#define CH9120_CFG0_PORT GPIOC
#define CH9120_CFG0_Pin  GPIO_Pin_9
#define CH9120_CFG0(x)   GPIO_WriteBit(CH9120_CFG0_PORT, CH9120_CFG0_Pin, (x))

#define CH9120_RSTI_PORT GPIOA
#define CH9120_RSTI_Pin  GPIO_Pin_11
#define CH9120_RSTI(x)   GPIO_WriteBit(CH9120_RSTI_PORT, CH9120_RSTI_Pin, (x))
/* Private macro -------------------------------------------------------------*/

/* Private variables ---------------------------------------------------------*/

/* Public variables ----------------------------------------------------------*/

/* Private function prototypes -----------------------------------------------*/

/* Private functions ---------------------------------------------------------*/

/* Private user code ---------------------------------------------------------*/

#endif  //__CH9120_H_
